package com.chinasoft.movies.controller;

import com.chinasoft.movies.pojo.Top5Company;
import com.chinasoft.movies.service.Top5CompanyService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Log4j2
@CrossOrigin
public class Top5CompanyController {

    @Autowired
    Top5CompanyService top5CompanyService;

    //总票房前五的公司的作品均分，票房，热度，产出
    //返回：String company; double avgVote; Long sumRevenue; double avgPopularity; Long movieCount;
    @GetMapping("/queryTop5Company")
    public List<Top5Company> queryTop10Company(){
        List<Top5Company> result = top5CompanyService.queryTop10Company();
        return result;
    }
}
